//
//  MessageCell.m
//  WhatsChat
//
//  Created by 檀琛 on 16/3/22.
//  Copyright © 2016年 tanchen. All rights reserved.
//

#import "MessageCell.h"

@implementation MessageCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    //注意此处的初始化方法.
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initLayout];
    }
    return self;
}

- (void)initLayout{
    CGRect rect = [[UIScreen mainScreen] bounds];
    CGFloat width = rect.size.width;
    //设置图片的位置
    self.aImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 60, 60)];
    self.aImageView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.aImageView];
    //初始化nameLabel
    self.nameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(80, 10, width - 90, 30))];
    self.nameLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.nameLabel];
    //初始化内容
    self.messageLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, 40, width - 90, 30)];
    self.messageLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.messageLabel];
    
    
    
    
    
    
    
    
}
@end
